home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / include / ObjectTcl-1.1 / otcl / OtclObject.H < prev    next >
Encoding:
C/C++ Source or Header  |  1995-06-29  |  4.0 KB  |  101 lines

  1. #ifndef OTCL_OBJECT_H
  2. #define OTCL_OBJECT_H
  3.  
  4. /*  _ __ ___ _
  5.  * | |\ /  /| |  $Id: OtclObject.H,v 1.5 1995/05/25 08:25:55 deans Exp $
  6.  * | | /  / | |  Copyright (C) 1995 IXI Limited.
  7.  * |_|/__/_\|_|  IXI Limited, Cambridge, England.
  8.  *
  9.  * Component   : OtclObject.H
  10.  *
  11.  * Author      : Dean Sheehan (deans@x.co.uk)
  12.  *  
  13.  * Description : Header file for OtclObject class that modesl instances of
  14.  *               OtclClasses and exported C++ classes.
  15.  *
  16.  * License     :
  17.             Object Tcl License & Copyright
  18.             -----------------------------
  19.  
  20. IXI Object Tcl software, both binary and source (hereafter, Software) is copyrighted by IXI Limited (IXI), and ownership remains with IXI. 
  21.  
  22. IXI grants you (herafter, Licensee) a license to use the Software for academic, research and internal business purposes only, without a fee. Licensee may distribute the binary and source code (if required) to third parties provided that the copyright notice and this statement appears on all copies and that no charge is associated with such copies. 
  23.  
  24. Licensee may make derivative works. However, if Licensee distributes any derivative work based on or derived from the Software, then Licensee will (1) notify IXI regarding its distribution of the derivative work, and (2) clearly notify users that such derivative work is a modified version and not the original IXI Object Tcl distributed by IXI. IXI strongly recommends that Licensee provide IXI the right to incorporate such modifications into future releases of the Software under these license terms. 
  25.  
  26. Any Licensee wishing to make commercial use of the Software should contact IXI, to negotiate an appropriate license for such commercial use. Commercial use includes (1) integration of all or part of the source code into a product for sale or license by or on behalf of Licensee to third parties, or (2) distribution of the binary code or source code to third parties that need it to utilize a commercial product sold or licensed by or on behalf of Licensee. 
  27.  
  28. IXI MAKES NO REPRESENTATIONS ABOUT THE SUITABILITY OF THIS SOFTWARE FOR ANY PURPOSE. IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. IXI SHALL NOT BE LIABLE FOR ANY DAMAGES WHATSOEVER SUFFERED BY THE USERS OF THIS SOFTWARE. 
  29.  
  30. Copyright (C) 1995, IXI Limited 
  31.  
  32. By using or copying this Software, Licensee agrees to abide by the copyright law and all other applicable laws of England and the U.S., including, but not limited to, export control laws, and the terms of this license. IXI shall have the right to terminate this license immediately by written notice upon Licensee's breach of, or non-compliance with, any of its terms. Licensee may be held legally responsible for any copyright infringement that is caused or encouraged by Licensee's failure to abide by the terms of this license. 
  33.  
  34. Comments and questions are welcome and can be sent to
  35. otcl@x.co.uk 
  36.  
  37. For more information on copyright and licensing issues, contact: 
  38. Legal Department, IXI Limited, Vision Park, Cambridge CB4 4ZR,
  39. ENGLAND. 
  40.  
  41.  *
  42.  */
  43.  
  44. // Tcl Includes
  45. #include <tcl.h>
  46.  
  47. // Public Defines
  48. #define OTCL_SELF_ATTRIBUTE "this"
  49.  
  50. // Forward Declarations
  51. class OtclClass;
  52. class OtclPart;
  53.  
  54. class OtclObject
  55. {
  56. public:   // Constructor & Destructor
  57.  
  58.    OtclObject ();
  59.  
  60.    ~OtclObject ();
  61.  
  62. public:   // Public Instance Methods
  63.  
  64.    void setPart (OtclPart *part);
  65.  
  66.    // This is nasty as it blows the encapsulation. I should really re-vist this
  67.    // and find a better solution
  68.    OtclPart **getPartPtrPtr (void);
  69.  
  70.    void setSelf (char *s);
  71.  
  72.    char *getSelf (void);
  73.  
  74.    virtual int executeMethod (Tcl_Interp *, char *method, int argc,
  75.                               char *argv[]);
  76.  
  77.    virtual int discard (Tcl_Interp *interp, int fromCpp);
  78.  
  79.    void addObjectScope (Tcl_Interp *);
  80.    void removeObjectScope (Tcl_Interp *);
  81.  
  82.    OtclPart *giveOtclPart (void);
  83.  
  84.    int discardingParts (void);
  85.  
  86.    // Cast it to the C++ base with the specified class name if
  87.    // applicable, otherwise NULL.
  88.    void *toCpp (char *cppClassName);
  89.  
  90. private:
  91.  
  92.    OtclPart *otclop;
  93.  
  94.    char *self;
  95.  
  96.    int discarding;
  97.  
  98. };
  99.  
  100. #endif // OTCL_OBJECT_H
  101.